class Solution
{
public:
    vector<int> findColumnWidth(vector<vector<int>> &grid)
    {
        int m = grid.size();
        int n = grid[0].size();

        vector<int> result(n, 0);
        for (int i = 0; i < m; ++i)
        {
            for (int j = 0; j < n; ++j)
            {
                int len = to_string(grid[i][j]).size();
                result[j] = max(result[j], len);
            }
        }
        return result;
    }
};